/*
 * @Author: 过峰 2452342725@qq.com
 * @Date: 2022-07-03 09:57:06
 * @LastEditors: 过峰 2452342725@qq.com
 * @LastEditTime: 2022-08-31 16:21:59
 * @FilePath: \desert-star\src\pages\PortfolioOverview\columns.tsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 绩效指标
import { toFixedTwo } from ".";
export const indicatorColumns = [
  {
    title: "指标",
    dataIndex: "name",
    key: "name",
    width: 100,
    ellipsis: true,
    render: (text?: string) => text || "-",
  },
  {
    title: "年化收益率",
    dataIndex: "年化收益率",
    key: "年化收益率",
    align: "right",
    width: 68,
    render: (text?: number) => toFixedTwo(text),
  },
  {
    title: "年化波动率",
    dataIndex: "年化波动率",
    key: "annualVolatility",
    align: "right",
    width: 68,
    render: (text?: number) => toFixedTwo(text),
  },
  {
    title: "下行风险",
    dataIndex: "下行风险",
    key: "downsideRisk",
    align: "right",
    width: 56,
    render: (text?: number) => toFixedTwo(text),
  },
  {
    title: "最大回撤",
    dataIndex: "最大回撤",
    key: "maxDrawDown",
    align: "right",
    width: 56,
    render: (text?: number) => toFixedTwo(text),
  },
  {
    title: "夏普比率",
    dataIndex: "夏普比率",
    key: "夏普比率",
    align: "right",
    width: 56,
    render: (text?: number) => (_.isNumber(text) ? text.toFixed(2) : "-"),
  },
  {
    title: "索提诺比率",
    dataIndex: "索提诺比率",
    key: "索提诺比率",
    align: "right",
    width: 70,
    render: (text?: number) => (_.isNumber(text) ? text.toFixed(2) : "-"),
  },
  {
    title: "卡玛比率",
    dataIndex: "卡玛比率",
    key: "卡玛比率",
    align: "right",
    width: 56,
    render: (text?: number) => (_.isNumber(text) ? text.toFixed(2) : "-"),
  },
];

// 组合
export const combinationColumns = [
  {
    title: "日期",
    dataIndex: "date",
    key: "date",
  },
  {
    title: "事件类型",
    dataIndex: "eventType",
    key: "eventType",
    render: (text?: string) => (text ? text : "-"),
  },
  {
    title: "内容",
    dataIndex: "content",
    key: "content",
    render: (text?: string) => (text ? text : "-"),
  },
  {
    title: "在图上标出",
    render: (text?: string) => (text ? text + "%" : "-"),
  },
];
